package com.exampl.springstack.common.exceptionUtils.vo;

import com.exampl.springstack.common.exceptionUtils.enums.ResultEnum;
import lombok.Data;

import java.util.List;

/**
 * @author qiangfanghao
 * @date
 * 分页数据
 */
@Data
public class PageResult<T> {


    /** 总条数 */
    private Long total;

    /** 当前页 */
    private Integer pageNo;

    /** 分页数 */
    private Integer pageSize;

    /** 当前页数据 */
    private List<T> data;

    /**
     * 状态码
     */
    private int code;

    /**
     * 消息
     */
    private String message;

    public PageResult() {
    }


    public PageResult(Long total, Integer pageNo, Integer pageSize, List<T> data) {
        this.code = ResultEnum.OK.getCode();
        this.message = ResultEnum.OK.getMessage();
        this.total = total;
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.data = data;
    }
}